/*
 * Copyright (c) 2015 Minshenglife. All rights reserved. Minshenglife
 * PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.sentry.commons.http;

import org.apache.http.client.ClientProtocolException;
import org.apache.http.impl.client.CloseableHttpClient;

import java.io.IOException;

/**
 * http请求执行器
 *
 * @param <T> 返回值类型
 * @param <E> 请求参数类型
 * @author WuBo (wub1@minshenglife.com)
 */
public interface RequestExecutor<T, E> {

    /**
     *
     * @param httpclient 传入的httpClient
     * @param uri uri
     * @param data 数据
     * @return
     * @throws ClientProtocolException
     * @throws IOException
     */
    public T execute(CloseableHttpClient httpclient, String uri, E data)
            throws ClientProtocolException, IOException;

}
